// 
// Copyright (C) 2006 Enterprise Distributed Technologies Ltd
// 
// www.enterprisedt.com
//

#region Change Log

// Change Log:
// 
// $Log: HexUtils.cs,v $
// Revision 1.2  2006/09/08 13:54:17  bruceb
// change hex algorithm
//
// Revision 1.1  2006/09/06 10:57:22  bruceb
// utils for hex
//
//

#endregion

using System;
using System.Text;

namespace EnterpriseDT.Util
{    
    /// <summary>
    /// Various hex utils
    /// </summary>
    internal class HexUtils
    {
        /// <summary>
        /// Convert a byte array to a string in hex
        /// </summary>
        /// <param name="data">byte array</param>
        /// <returns>hex string</returns>
        public static string ToHex(byte[] data)
        {
            StringBuilder str = new StringBuilder();
            for (int i = 0; i < data.Length; i++)
            {
                str.Append(data[i].ToString("X2"));
            }
            return str.ToString();
        }
    }
}
